import axios from "../index.js";



// 查询所有角色集合
export const roleList = (data) => {
  return axios.request({
    url: "/system/role/doPageList",
    method: "post",
    data: data
  });
};



// 查询所有角色集合 不分页
export const roleDoList = (data) => {
  return axios.request({
    url: "/system/role/doList",
    method: "post",
    data: data
  });
};


// 角色新增
export const roleAdd = (data) => {
  return axios.request({
    url: "/system/role/save",
    method: "post",
    data: data
  });
};

// 角色删除
export const roleDelete = (data) => {
  return axios.request({
    url: "/system/role/doDelete",
    method: "get",
    data: data
  });
};

// 角色详情
export const roleDetail = (data) => {
  return axios.request({
    url: "/system/role/getById",
    method: "get",
    data: data
  });
};

// 角色编辑
export const roleEdit = (data) => {
  return axios.request({
    url: "/system/role/doUpdById",
    method: "post",
    data: data
  });
};

// 当前角色下账户
export const roleAccount = (data) => {
  return axios.request({
    url: "/system/account/getAccountByRole",
    method: "post",
    data: data
  });
};

// 删除角色下账户
export const deleteRoleAccount = (data) => {
  return axios.request({
    url: "/system/roleAccount/deleteById",
    method: "post",
    data: data
  });
};

// 用户关联角色
export const accountConcatRloe = (data) => {
  return axios.request({
    url: "/system/roleAccount/save",
    method: "post",
    data: data
  });
};

// 用户关联多个角色
export const doSaveOrUpdate = (data) => {
  return axios.request({
    url: "/system/roleAccount/doSaveOrUpdate",
    method: "post",
    data: data
  });
};


// 组织机构详情
export const getById = (data) => {
  return axios.request({
    url: "/system/organization/getById",
    method: "get",
    data: data
  });
};


